package com.example.demo_day02.pojo;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import javax.validation.constraints.NotNull;
import java.util.Date;

@Data
@TableName("tb_automobile")
public class TbAutomobile {

    private static final long serialVersionUID = 1L;

    //车辆ID
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    //车牌号
    @NotNull(message = "车辆号不能为空")
    @TableField("license_number")
    private String licenseNumber;
    //车型
    @NotNull(message = "车型不能为空")
    @TableField("vehicle_model")
    private String vehicleModel;
    //编号
    @NotNull(message = "编号不能为空")
    @TableField("number")
    private Integer number;
    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd hh:MM:ss",timezone = "GMT+8")
    @NotNull(message = "创建时间不能为空")
    @TableField("create_time")
    private Date createTime;
    //修改时间
    @JsonFormat(pattern = "yyyy-MM-dd hh:MM:ss",timezone = "GMT+8")
    @NotNull(message = "修改时间不能为空")
    @TableField("update_time")
    private Date updateTime;
    //是否删除 1是 0否
    @TableField("is_deleted")
    private Boolean isDeleted;
    //备注
    @NotNull(message = "备注不能为空")
    @TableField("note")
    private String note;

    public TbAutomobile() {
    }

    public TbAutomobile(Integer id, @NotNull(message = "车辆号不能为空") String licenseNumber, @NotNull(message = "车型不能为空") String vehicleModel, @NotNull(message = "编号不能为空") Integer number, @NotNull(message = "创建时间不能为空") Date createTime, @NotNull(message = "修改时间不能为空") Date updateTime, Boolean isDeleted, @NotNull(message = "备注不能为空") String note) {
        this.id = id;
        this.licenseNumber = licenseNumber;
        this.vehicleModel = vehicleModel;
        this.number = number;
        this.createTime = createTime;
        this.updateTime = updateTime;
        this.isDeleted = isDeleted;
        this.note = note;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLicenseNumber() {
        return licenseNumber;
    }

    public void setLicenseNumber(String licenseNumber) {
        this.licenseNumber = licenseNumber;
    }

    public String getVehicleModel() {
        return vehicleModel;
    }

    public void setVehicleModel(String vehicleModel) {
        this.vehicleModel = vehicleModel;
    }

    public Integer getNumber() {
        return number;
    }

    public void setNumber(Integer number) {
        this.number = number;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Boolean getDeleted() {
        return isDeleted;
    }

    public void setDeleted(Boolean deleted) {
        isDeleted = deleted;
    }

    public String getNote() {
        return note;
    }

    public void setNote(String note) {
        this.note = note;
    }

    @Override
    public String toString() {
        return "TbAutomobile{" +
                "id=" + id +
                ", licenseNumber='" + licenseNumber + '\'' +
                ", vehicleModel='" + vehicleModel + '\'' +
                ", number=" + number +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", isDeleted=" + isDeleted +
                ", note='" + note + '\'' +
                '}';
    }
}
